Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Context notion. #424

Merged
merged 85 commits into from
Feb 12, 2020
Merged

Conversation

carlosalberto
Copy link
Contributor

This PR intends to include some of the changes of OTEP 66, by making the Specification Context aware.

Summary of changes:

  1. Add a Context mechanism section to describe what is expected in all languages overall. This is mostly described as a SDK API, in order to signal that users instrumenting their application shouldn't use it directly.
  2. Update Propagators to make them directly consume Context.
  3. Relax the Tracer's current Span handling as this now belongs to Context (changes this part from MUST to SHOULD).
  4. Removed Binary support for now. Binary needs to be updated to play along well, and it's still a work in progress anyway. The plan is to add it again in the near future, once it has been prototyped/tested.

I'm specially interested in feedback regarding 1), so feel free to provide insights ;)

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start.

specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-tracing.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/overview.md Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-propagators.md Outdated Show resolved Hide resolved
specification/api-tracing.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/overview.md Show resolved Hide resolved
carlosalberto and others added 4 commits January 27, 2020 14:23
Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>
Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>
Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>
Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>
@bogdandrutu
Copy link
Member

Last comment that needs to be addressed is about Restore/Detach, once that is resolved will merge.

specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
specification/context.md Outdated Show resolved Hide resolved
carlosalberto and others added 9 commits February 12, 2020 17:09
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
Co-Authored-By: John Watson <jkwatson@gmail.com>
@bogdandrutu bogdandrutu merged commit 33ce3e1 into open-telemetry:master Feb 12, 2020
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
* Initial context integration.

* Update api-propagators.md

* Remove the mention of binary propagators.

* Mention that the tracing's propagation must happen internally.

* Make context -> Context.

* Rename api-context.md to context.md

* Remove the notion of key.

* Add a note on Context being a SDK API.

* Note on the optional global operations.

* Clean up pass.

* Remove context-prop from the *tracing* index.

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* First clean up pass over Context.

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Overview and layout updates.

* Make the MD linter happy (long lines though).

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Use MUST/SHOULD for clarifying propagators expectations.

* Move the IsRemote deserialization note to the Extraction section.

* Improve wording for Context handling in Extraction.

* Clarify the protected global methods in context.md

* Remove the extra explanation of Context in overview.md

* Improve the wording for set/remove values in context.md

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Fix style?

* Clarify the Context usage in Extract.

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Clarify IsRemote on Extract.

* More style changes.

* OTel MUST provide Context impl if none exists.

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Reword the optionality of Context in propagators.

* Clarify again the expected usage for implicit `Context`.

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Be more strict on the Context parameters.

* Clarify that SDK/OTel instrumentation only SHOULD use global Context.

* Mention that Context will be used through concerns APIs.

* Update specification/api-propagators.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update specification/api-propagators.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* We do not use the Required word anymore.

* Do not require extract to set null/empty upon errors.

* Better wording for failed extraction values.

* Update specification/context.md

Co-Authored-By: Yuri Shkuro <yurishkuro@users.noreply.github.com>

* Clarify ONCE that Context is immutable.

* Use "derived" instead of "child" for Context-Context relationships.

* Remove a misleading line.

* Mention tracing uses Context specifially.

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Clarify that Context keeps the untouched original values.

* Clarify a new Context is created only for write operations.

* Misc fixes.

* Set current Context should return a handle.

* Note on global Context operations.

* Remove the Remove operation on Context.

* Clarify the usage of cross-cutting concern APIs.

* Restore "Create a key" section.

* Minor fix to a previous commit.

* Add a detach operation.

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/api-tracing.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Use value instead of object for Token.

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Bogdan Drutu <lazy@splunk.com>
carlosalberto added a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* Initial context integration.

* Update api-propagators.md

* Remove the mention of binary propagators.

* Mention that the tracing's propagation must happen internally.

* Make context -> Context.

* Rename api-context.md to context.md

* Remove the notion of key.

* Add a note on Context being a SDK API.

* Note on the optional global operations.

* Clean up pass.

* Remove context-prop from the *tracing* index.

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* First clean up pass over Context.

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Overview and layout updates.

* Make the MD linter happy (long lines though).

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/context.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Use MUST/SHOULD for clarifying propagators expectations.

* Move the IsRemote deserialization note to the Extraction section.

* Improve wording for Context handling in Extraction.

* Clarify the protected global methods in context.md

* Remove the extra explanation of Context in overview.md

* Improve the wording for set/remove values in context.md

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Christian Neumüller <christian+github@neumueller.me>

* Update specification/api-propagators.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Fix style?

* Clarify the Context usage in Extract.

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Clarify IsRemote on Extract.

* More style changes.

* OTel MUST provide Context impl if none exists.

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Reword the optionality of Context in propagators.

* Clarify again the expected usage for implicit `Context`.

* Update specification/context.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Be more strict on the Context parameters.

* Clarify that SDK/OTel instrumentation only SHOULD use global Context.

* Mention that Context will be used through concerns APIs.

* Update specification/api-propagators.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update specification/api-propagators.md

Co-Authored-By: Tyler Yahn <MrAlias@users.noreply.github.com>

* We do not use the Required word anymore.

* Do not require extract to set null/empty upon errors.

* Better wording for failed extraction values.

* Update specification/context.md

Co-Authored-By: Yuri Shkuro <yurishkuro@users.noreply.github.com>

* Clarify ONCE that Context is immutable.

* Use "derived" instead of "child" for Context-Context relationships.

* Remove a misleading line.

* Mention tracing uses Context specifially.

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Clarify that Context keeps the untouched original values.

* Clarify a new Context is created only for write operations.

* Misc fixes.

* Set current Context should return a handle.

* Note on global Context operations.

* Remove the Remove operation on Context.

* Clarify the usage of cross-cutting concern APIs.

* Restore "Create a key" section.

* Minor fix to a previous commit.

* Add a detach operation.

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/api-propagators.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/context.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Update specification/api-tracing.md

Co-Authored-By: John Watson <jkwatson@gmail.com>

* Use value instead of object for Token.

Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Bogdan Drutu <lazy@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.